package com.cloud.Enum;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum ConsumerTypeEnum {

    ROCKETMQ("1", "MQ"),
    COMMON_FEIGN("2", "commonFeign"),
    BRIDGE_FEIGN("3", "bridgeFeign"),
    HTTPCLIENT("4", "HttpClient");

    /**
     * 类型编码
     */
    private String code;

    /**
     * 类型名称
     */
    private String name;

    public static String getName(String code) {
        for (ConsumerTypeEnum consumerTypeEnum : ConsumerTypeEnum.values()) {
            if (consumerTypeEnum.getCode().equals(code)) {
                return consumerTypeEnum.getName();
            }
        }
        return null;
    }
}
